import ajax from "@/utils/request";

// 验证手机号是否被注册
export function docheckphone(data: { tel: string }) {
    return ajax({
        url: "/user/docheckphone",
        method: "POST",
        data,
    });
}

// 获取短信验证码
export function dosendmsgcode(data: { tel: string }) {
    return ajax({
        url: "/user/dosendmsgcode",
        method: "POST",
        data,
    });
}

// 验证短信验证码
export function docheckcode(data: { tel: string; telcode: string }) {
    return ajax({
        url: "/user/docheckcode",
        method: "POST",
        data,
    });
}

// 发送注册请求
export function dofinishregister(data: { tel: string; password: string }) {
    return ajax({
        url: "/user/dofinishregister",
        method: "POST",
        data,
    });
}

// 发送登录请求
export function login(data: { loginname: string; password: string }) {
    return ajax({
        url: "/user/login",
        method: "POST",
        data,
    });
}
